package com.weiaibenpao.demo.chislim.presenter;

import com.weiaibenpao.demo.chislim.base.BasePresenter;
import com.weiaibenpao.demo.chislim.bean.SportHistoryBean;
import com.weiaibenpao.demo.chislim.retrofit.RetrofitUtils;
import com.weiaibenpao.demo.chislim.retrofit.rx.NetWorkTransformer;
import com.weiaibenpao.demo.chislim.retrofit.rx.SimpleObserver;
import com.weiaibenpao.demo.chislim.view.SportHistoryView;

/**
 * Created by wlx on 2017/12/13.
 */

public class SportHistoryPresenter extends BasePresenter<SportHistoryView> {
    public void getDjqMall(int id ,int page,int size){
        RetrofitUtils.getAPIService().getSportHistory(id, page,size).
                compose(new NetWorkTransformer<SportHistoryBean>())
//                .compose(new LoadingTransformer<SportHistoryBean>(mContext))
                .subscribe(new SimpleObserver<SportHistoryBean>(mCompositeDisposable) {
                    @Override
                    public void call(SportHistoryBean sportHistoryBean) {
                        getView().sportHistorySuccess(sportHistoryBean);
                    }
                });
    }
}
